<style type="text/css">@import url("modules/Dashboard/activities.css"); </style>
<h3>{$modStrings.LBL_RESEARCH_REPORTS_TITLE}</h3>
<br>
{include file='modules/Dashboard/activities_filter.tpl' assign=activities_filter}
{$activities_filter}

{assign var="i" value = "1"}
{assign var="accountsTotal" value = "0"}
{assign var="callsTotal" value = "0"}
{assign var="oppTotal" value = "0"}
<div id="container" style="width: 870px;">
    <table id ="main" class="researchReportTable" cellpadding="0" cellspacing="0">
        <thead>
        <tr class="hedarRowResearchReport">
            <th class="iconPlusMinus" style="cursor: default;">&nbsp;</th>
            <th class="topTitle lp">L.p.</th>
            <th class="topTitle userNameTop">{$modStrings.LBL_CONSULTANT_NAME}</th>
            <th class="topTitle assAccounts">{$modStrings.LBL_ASSIGNED_ACCOUNTS}</th>
            <th class="topTitle finishedAccTop" colspan="2">{$modStrings.LBL_CALLS_OR_MEETINGS_ADDED}</th>
            <th class="topTitle finishedOppTop" colspan="2">{$modStrings.LBL_OPP_ADDED}</th>
        </tr>
        <tr>
            <th colspan="3" class="noBorderBottom" style="width: 203px">&nbsp;</th>
            <th class="assAccounts numberPercent noBorderBottom">{$modStrings.LBL_NUMBER}</th>
            <th class="finishedAccNo numberPercent noBorderBottom">{$modStrings.LBL_NUMBER}</th>
            <th class="finishedAccPercent numberPercent noBorderBottom">{$modStrings.LBL_PERCENT}</th>
            <th class="finishedOppNo numberPercent noBorderBottom">{$modStrings.LBL_NUMBER}</th>
            <th class="finishedOppPercent numberPercent noBorderBottom">{$modStrings.LBL_PERCENT}</th>
        </tr>
        </thead>
        <tbody>
            <tr>
                <td colspan="8" class="mainRowContainer">
                    {foreach from=$report key=label item=rep name="userReportLoop"}
                        <table class="mainRow" cellspacing="0" cellpadding="0">
                            <thead>
                                <tr class="{if $smarty.foreach.userReportLoop.index mod 2 eq 0}lightRow{else}darkRow{/if}">
                                    <th class="click iconPlusMinus noBorderRight noBorderBottom noBorderLeft" id="{$rep.userId}">
                                        {if $accessToUserReport}
                                        <img alt="+" src="themes/default/images/plus.gif" width="10" height="10" />
                                        {/if}
                                    </th>
                                    <th class="lp click noBorderRight noBorderBottom" align="left">{$i}.</th>
                                    <th class="userName click noBorderRight noBorderBottom" style="text-align: left">{$rep.userName}</th>
                                    <th class="assAccounts click noBorderRight noBorderBottom">{$rep.assignedAccounts}</th>
                                    <th class="finishedAccNo click noBorderRight noBorderBottom">{$rep.callsOrMeetingsNo}</th>
                                    <th class="finishedAccPercent click noBorderRight noBorderBottom">{$rep.callsOrMeetingsPercent|string_format:"%2.2f"}</th>
                                    <th class="finishedOppNo click noBorderRight noBorderBottom">{$rep.oppNo}</th>
                                    <th class="finishedOppPercent click noBorderBottom">{$rep.oppPercent|string_format:"%2.2f"}</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr><td colspan="8" class="noBorderBottom noBorderLeft"></td></tr>
                            </tbody>
                            {assign var="a" value = $rep.assignedAccounts}
                            {assign var="accountsTotal" value = $accountsTotal+$rep.assignedAccounts}
                            {assign var="callsTotal" value = $callsTotal+$rep.callsOrMeetingsNo}
                            {assign var="oppTotal" value = $oppTotal+$rep.oppNo}
                            {assign var="i" value=$i+1}
                        </table>
                    {/foreach}
                </td>
            </tr>
            {if $callsTotal > 0}
                    {assign var="callsTotalProc" value = $callsTotal/$accountsTotal}
            {else}
                    {assign var="callsTotalProc" value = 0}
            {/if}
            {if $oppTotal > 0}
                    {assign var="oppTotalProc" value = $oppTotal/$accountsTotal}
            {else}
                    {assign var="opTotalProc" value = 0}
            {/if}
            <tr>
                <td class="topTitle" colspan="3">&nbsp;</td>
                <td class="topTitle">{$accountsTotal}</td>
                <td class="topTitle">{$callsTotal}</td>
                <td class="topTitle">{$callsTotalProc|string_format:"%2.2f"}</td>
                <td class="topTitle">{$oppTotal}</td>
                <td class="topTitle">{$oppTotalProc|string_format:"%2.2f"}</td>
            </tr>
        </tbody>
    </table>
</div>
<div id="loader">
    <div class="containerGif"><img src="themes/default/images/ajax-loader.gif" /></div>
</div>

